1. Field of the Invention
The present invention relates to an image data processing apparatus used in, for example, a facsimile or an image, scanner. More specifically, the present invention relates to an image data processing apparatus suitably applied so as to perform filtering processing utilizing the correlation of data between read lines and isolated point removal processing for removing a white pixel and a black pixel which are isolated in a binary image. In addition, the present invention relates to an image data processing apparatus suitably applied so as to perform so-called error diffusion processing for reproducing a halftone with respect to multivalued density data optically read.
2. Description of the Related Art
In, for example, a facsimile, data read by an image sensor is subjected to so-called filtering processing for emphasizing a binary image. Such filtering processing is performed by paying attention to a pixel and referring to data corresponding to pixels in the vicinity of the pixel paid attention to.
In order to perform the filtering processing, a line memory capable of storing data corresponding to pixels whose number is three times the number of pixels constituting a line read by the image sensor is used. That is, data corresponding to three lines can be stored in this line memory.
Data corresponding to a line including a target pixel, and lines ahead of and behind the line are written to this line memory. The target pixel is subjected to processing on the basis of each of the data corresponding to pixels arranged in a matrix with 3.times.3 pixels centered with respect to the target pixel. That is, the data corresponding to the target pixel and the data corresponding to the pixels having predetermined positional relationships with the pixel paid attention to are subjected to a predetermined operation, and the data corresponding to the target pixel is subjected to processing such as emphasis processing on the basis of the result of the operation.
This emphasis processing is processing for so increasing or decreasing data that white and black colors clearly appear with respect to a binary image. In the above described filtering processing, therefore, an image portion which is judged to be a halftone image, for example, is not subjected to the emphasis processing.
In the above described filtering processing, a line memory corresponding to three lines for creating a matrix with 3.times.3 pixels centered with respect to a target pixel is used. In addition, a line memory corresponding to a plurality of lines is generally required for processing performed on the basis of the correlation between adjacent lines, for example, not only the above described filtering processing but also isolated point removal processing as described later. In this case, if a matrix with N.times.N pixels must be created, a memory corresponding to N lines is generally used.
From the viewpoint of the effective utilization of storage areas in a memory device provided for a facsimile or the like, however, it is desirable to reduce the capacity of a line memory required for filtering processing, isolated point removal processing and the like. In addition, if a memory device having a small storage capacity can be used by reducing the capacity of the line memory, the cost can be also reduced. Consequently, the reduction of the capacity of the line memory required for filtering processing or the like is an indispensable subject.
On the other hand, in the facsimile or the like, density data for each of pixels constituting an image optically read is binary-coded, thereby to generate a binary image. In this binary image, a phenomenon that a pixel to be inherently a white pixel is a block pixel or the reverse phenomenon occurs due to, for example, the nonuniformity in conveyance of a document. Therefore, a technique for rejudging whether a target pixel is white or black depending on the shape of a black-and-white distribution of a group of pixels in the vicinity of the target pixel to perform isolated point removal processing using a value obtained by the rejudgment as binary data corresponding to the target pixel, has been conventionally known.
Such a technique is disclosed in, for example, Japanese Patent Publication No. 59513/1987. In this official gazette, a technique for eliminating the effect of jitter such as the nonuniformity in rotation or vibration of a reading device is disclosed. Specifically, even when a document image is a linear image perpendicular to the main scanning direction P as shown in FIG. 39 (a), a projected portion denoted by reference numeral 161 occurs in a read image shown in FIG. 39 (b) due to the effect of jitter.
This projected portion is shown in an enlarged manner in FIG. 40. Specifically, the projected portion due to the jitter is constituted by a pixel 162 projected along the main scanning direction P at the time of reading a document. This pixel 162 has no continuous pixels in a direction at right angles to the main scanning direction P, that is, is isolated in the direction at right angles to the main scanning direction P.
In a case where an image portion shown in FIG. 41 (a) or FIG. 42 (a) exists in a read image, therefore, if the image portion is converted into an image shown in FIG. 41 (b) or FIG. 42 (b), it is possible to prevent the degradation of the image due to the above described jitter.
Referring to FIG. 43, such conversion of the image can be made by rejudging a value of a target pixel X on the basis of the values of pixels a1, a2, a3, b1, X, b3, c1, c2 and c3 constituting a matrix with 3.times.3 pixels centered with respect to the target pixel X. Specifically, in a case where the target pixel X is a black pixel, if the pixels a1, a2, b1, c1 and c2 are all white pixels, the value of the target pixel X is so inverted that the target pixel X becomes a white pixel. Consequently, the conversion shown in FIG. 41 can be made. On the other hand, in a case where the target pixel X is a white pixel, if the pixels a1, a2, b1, c1 and c2 are all black pixels, the value of the target pixel X is so inverted that the target pixel X becomes a black pixel. Consequently, the conversion shown in FIG. 42 can be made.
Such processing is performed by the construction shown in FIG. 44. A video signal representing a binary image is inputted to a correlation judging circuit 180 through registers 171 and 172 capable of respectively holding a signal corresponding to one pixel. A signal from the register 172 is further applied to a shift register 173 for delaying a signal by one line. A signal from the shift register 173 is applied to the correction judging circuit 180 through registers 174 and 175. In addition, a signal from the register 175 is inputted to the correlation judging circuit 180 from registers 177 and 178 through a shift register 176 for delaying a signal by one line.
An input video signal and respective output signals of the registers 171 to 173 and 175 to 178 are applied to the correlation judging circuit 180, and the signals respectively have the following one-to-one correspondence with pixels constituting a matrix with 3.times.3 pixels shown in FIG. 43:
input video signal . . . pixel c3 PA1 register 171 . . . pixel c2 PA1 register 172 . . . pixel c1 PA1 shift register 173 . . . pixel b3 PA1 register 175 . . . pixel b1 PA1 shift register 176 . . . pixel a3 PA1 register 177 . . . pixel a2 PA1 register 178 . . . pixel a1
Furthermore, an output signal of the register 174 corresponds to the target pixel X. The output signal of this register 174 is applied to a register 179 from a line 181.
Based on input signals corresponding to eight pixels, the correlation judging circuit 180 applies a signal X1 to the register 179 when signals corresponding to the eight pixels a1, a2, a3, b1, b3, c1, c2 and c3 surrounding the target pixel X are in the state shown in FIG. 41 (a), while applying a signal X2 to the register 179 when they are in the state shown in FIG. 42 (a). This register 179 outputs a signal corresponding to a white pixel when the signal X1 is applied, while outputting a signal corresponding to a black pixel when the signal X2 is applied. In such a manner, the target pixel X is subjected to correction, thereby to realize conversion shown in FIG. 41 and conversion shown in FIG. 42.
However, the above described prior art has for its object to correct an isolated pixel caused by jitter. Therefore, it is impossible to remove an isolate pixel caused by the other cause. Specifically, when the value of a target pixel (indicated by a sign "*") differs from the values of eight pixels around the target pixel, as shown in FIG. 27, due to, for example, dirt on the surface of a document, the value of this target pixel is not inverted. The prior art does not thus cover all such correlations as to invert the values of pixels, so that an isolated pixel in a binary image cannot be completely removed.
In a state where the isolated pixel remains, compression efficiency in compression coding processing performed in, for example, a facsimile is reduced, so that the amounts of codes are uselessly increased. Therefore, time required for communication becomes long. When a chargeable communication line is used, the communication cost rises.
On the other hand, in the above described prior art, the shift registers 173 and 176 for delaying a signal by one line are specifically used so as to prepare a matrix with 3.times.3 pixels on the basis of signals inputted in accordance with the order of scanning at the time of reading. Therefore, the construction becomes complicated and the cost rises.
In order to perform isolated pixel removal processing without using shift registers or the like, it is considered that storage areas in a memory device provided for a facsimile or the like are utilized. In this case, the isolated pixel removal processing is processing handling data corresponding to three lines. Accordingly, a line memory corresponding to three lines is generally formed in the storage areas in the memory device, as in the filtering processing.
From the viewpoint of the effectively utilization of the storage areas in the memory device, however, it is desirable to reduce the capacity of the line memory. In addition, if a memory device having a small storage capacity can be used by reducing the capacity of the line memory, the cost can be also reduced.
In the conventional facsimile, in addition to the above described problems, there is a problem that time required for error diffusion processing performed as one of halftone processing is long, so that the speed of the entire image processing is decreased, as described below.
Specifically, in an apparatus for representing an image optically read by a binary image, for example, a facsimile, a variety of halftone processing has been conventionally applied so as to represent a halftone image such as a photograph. One of the halftone processing is error diffusion processing.
In the error diffusion processing, when a given pixel is binary-coded, a binary-coded error which is an error between multivalued density data corresponding to the pixel before binary-coding and density data corresponding to the pixel after binary-coding is operated. Specifically, in binary-coding processing, density data of a target pixel and a predetermined threshold value are compared with each other, so that the target pixel becomes a white pixel or a black pixel depending on the result of the comparison. With respect to a pixel having an intermediate density, therefore, an error inevitably occurs between the density of the pixel before binary-coding and the density thereof after binary-coding.
This binary-coded error produced in the given pixel is suitably weighted and distributed to pixels in the vicinity of the pixel. In binary-coding processing with respect to a target pixel, density data of the target pixel and binary-coded errors distributed from pixels in the vicinity of the target pixel are added to each other, and the result of the addition is compared with a predetermined threshold value.
For example, as shown in FIG. 17, when a pixel PO belonging to a given line along the main scanning direction at the time of reading by an image sensor provided for a facsimile or the like is binary-coded, a binary-coded error is produced. This binary-coded error is multiplied by an error diffusion coefficient 1/4 or 1/8 and distributed to pixels P1 to P6 in the vicinity of the pixel P0.
On the other hand, referring to FIG. 18, when attention is drawn to a pixel to which binary-coded errors are distributed, binary-coded errors are distributed to a target pixel A from pixels B, C, D, E, F and G in the vicinity of the target pixel A. Consequently, binary-coding processing with respect to the target pixel A is performed on the basis of a value obtained by adding the errors distributed from the pixels B, C, D, E, F and G in the vicinity of the target pixel A to density data of the target pixel A.
In the above described manner, the binary-coded error produced in each pixel is distributed to pixels in the vicinity of the pixel, thereby to achieve a representation of a halftone.
In order to realize such error diffusion processing, a binary-coded error produced in each pixel is stored in the memory for each pixel. For example, in the case of the binary-coding processing with respect to the target pixel A, the binary-coded errors in the pixels B, C, D, E, F and G are respectively read out from the memory. The binary-coded errors are respectively multiplied by error diffusion coefficients corresponding to the positional relationships with the target pixel A. The respective products and the density data of the target pixel A are added to each other, to find a value which is to be subjected to binary-coding judgment.
If the binary-coded error produced in each pixel is stored in the memory for each pixel as described above, access to the memory must be made, when binary-coding processing is performed with respect to a target pixel, by the number of pixels whose errors are distributed to the target pixel. Therefore, time required for the error diffusion processing is long, so that the speed of the entire image processing is reduced.